package com.example.myapplication.activity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import com.example.myapplication.R;
import com.example.myapplication.adapter.BannerAdapter;

public class BannerFragment extends Fragment {

    public BannerFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_banner, container, false);

        ViewPager viewPager = view.findViewById(R.id.viewPagerBanner);
        int[] bannerImages = {R.drawable.banner1, R.drawable.banner2, R.drawable.banner3, R.drawable.banner4, R.drawable.banner5};
        BannerAdapter bannerAdapter = new BannerAdapter(requireActivity(), bannerImages);
        viewPager.setAdapter(bannerAdapter);

        return view;
    }
}
